﻿<%@ Page Language="C#" MasterPageFile="~/PaginaInicio.master" AutoEventWireup="true" CodeFile="Alta_Alimento.aspx.cs" Inherits="AltaAlimento" Title="Alta de Alimento" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  <style type="text/css">
        .style5
        {
            width: 549px;
        }
        
           
        .accordionCabecera
{

background-color: #118BD9;
font-family: Tahoma;
font-size: 12px;
font-weight: bold;
margin-bottom: 2px;
padding: 2px;
cursor: pointer;
Height: 20px;
color: #CCCCCC;

}


.accordionContenido
{
font-family: Tahoma;
background-color: #0085C6;
border: none;

border-top: none;
margin-bottom: 7px;
font-size: 12px;
padding: 3px;
}


        .tablaEncabezado
        {
            color: #FFFFFF;
            height: 15px;
            font-family: Tahoma;
            font-size: medium;
            background-color: #C62D73;
            font-size: small;
            
        }
        
                .style27
        {
            color: #FFFFFF;
            height: 23px;
            font-family: Tahoma;
            font-size: medium;
        }
        .style62
        {
            width: 438px;
            text-align: right;
        }
        .style63
        {
          width: 100%;
          text-align: left;
          margin-left: 80px;
      }
        .style64
      {
          text-align: left;
          margin-left: 80px;
      }
        .style65
      {
          width: 106px;
          text-align: left;
          margin-left: 80px;
      }
        .style66
      {
          width: 238px;
          text-align: left;
          margin-left: 80px;
          height: 147px;
      }
      .style67
      {
          width: 106px;
          text-align: left;
          margin-left: 80px;
          height: 147px;
      }
                    
           
        .style10
        {
            border: medium solid #0085C6;
            width: 228px;
            color: #CCCCCC;
            font-size: small;
            font-family: Tahoma;
            margin-left: 0px;
            margin-right: 0px;
            margin-top: 0px;
        }
        
                           
        .style68
      {
          text-align: left;
          margin-left: 80px;
          width: 238px;
      }
        
                           
        </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

   

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<script src="jquery-1.4.2.js" type="text/javascript"></script>

    <script src="jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
                     <script type="text/javascript" language="javascript">

jQuery(document).ready(function(){
	$('.accordion .head').click(function() {
		$(this).next().toggle();
		return false;
	}).next().hide();
});


      $(document).ready(function() {
            //agregar una nueva columna con todo el texto
            //contenido en las columnas de la grilla
           // contains de Jquery es CaseSentive, por eso a minúscula

          $(".filtrar tr:has(td)").each(function() {
          var t = $(this).text().toLowerCase(); 
                    $("<td class='indexColumn'></td>")
                    .hide().text(t).appendTo(this);
                });

            //Agregar el comportamiento al texto (se selecciona por el ID)
            $("#FilterTextBox").keyup(function() {
                var s = $(this).val().toLowerCase().split(" ");
                $(".filtrar tr:hidden").show();
                $.each(s, function() {
                     $(".filtrar tr:visible .indexColumn:not(:contains('"
                     + this + "'))").parent().hide();
                }); 
            }); 
        });

</script>

    
    <table style="width: 100%;" cellspacing="-1">
        <tr>
            <td>
                &nbsp;</td>
            <td class="style5">
                <asp:Panel ID="Panel1" runat="server" Height="100%"  
                        Width="560px">
                
                    <table style="width: 100%;" cellpadding="-1" cellspacing="-1">
                        <tr>
                            <td bgcolor="#C62D73" class="style27" 
                             
                                style="border-bottom-color: #000000; border-bottom-width: medium; border-bottom-style: solid;" 
                                colspan="2">
                                 Alta de Alimentos</td>
                        </tr>
                        <tr>
                            <td colspan="2" bgcolor="#00334C" style="text-align: center">
                                
                              <table style="width: 98%; margin-left: 5px; margin-right:10px; margin-bottom:5px; margin-top:5px;" 
                                    bgcolor="#00547D" cellpadding="-1" cellspacing="4">
                                    <tr>
                                         <td class="style68">
                                             <asp:TextBox ID="txtNombre" runat="server" BackColor="#0085C6" 
                                                 BorderStyle="None" BorderWidth="0px" Font-Italic="True" ForeColor="#CCCCCC" 
                                                 Height="20px" Width="200px"></asp:TextBox>
                                             <cc1:TextBoxWatermarkExtender ID="txtNombre_TextBoxWatermarkExtender" 
                                                 runat="server" TargetControlID="txtNombre" 
                                                 WatermarkText="Nombre">
                                             </cc1:TextBoxWatermarkExtender>
                                        </td>
                                         <td class="style65">
                                             <asp:UpdatePanel ID="UpdatePanel7" runat="server">
                                                 <ContentTemplate>
                                                     <asp:Label ID="lblCheckNombre" runat="server" style="color: #990000" Text="*" 
                                                         Visible="False"></asp:Label>
                                                 </ContentTemplate>
                                                 <Triggers>
                                                     <asp:AsyncPostBackTrigger ControlID="btnGuardar" EventName="Click" />
                                                 </Triggers>
                                             </asp:UpdatePanel>
                                         </td>
                                         <td class="style63">
                                             &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td class="style64" colspan="3">
                                            <asp:TextBox ID="tbxDescripcion" runat="server" BackColor="#0085C6" 
                                                BorderStyle="None" BorderWidth="0px" Font-Size="Small" ForeColor="#CCCCCC" 
                                                Height="63px" style="font-family: Tahoma; text-align: left;" TextMode="MultiLine" 
                                                Width="489px"></asp:TextBox>
                                            <cc1:TextBoxWatermarkExtender ID="tbxDescripcion_TextBoxWatermarkExtender" 
                                                runat="server" TargetControlID="tbxDescripcion" 
                                                WatermarkText="Descripcion">
                                            </cc1:TextBoxWatermarkExtender>
                                        </td>
                                    </tr>
                                    <tr>
                                         <td class="style68">
                                             <asp:DropDownList ID="ddlTipoAlimento" runat="server" 
                                                 AppendDataBoundItems="True" BackColor="#0085C6"  
                                                
                                                style="font-family: Tahoma; height: 26px; font-style: italic;" 
                                                 Width="200px">
                                                <asp:ListItem Value="Salon">Tipo Alimento</asp:ListItem>
                                            </asp:DropDownList></td>
                                         <td class="style65">
                                             &nbsp;
                                             <asp:UpdatePanel ID="UpdatePanel8" runat="server">
                                                 <ContentTemplate>
                                                     <asp:Label ID="lblCheckTAlimento" runat="server" style="color: #990000" 
                                                         Text="*" Visible="False"></asp:Label>
                                                 </ContentTemplate>
                                                 <Triggers>
                                                     <asp:AsyncPostBackTrigger ControlID="btnGuardar" EventName="Click" />
                                                 </Triggers>
                                             </asp:UpdatePanel>
                                        </td>
                                         <td class="style63" rowspan="2" valign="top">
                                             <div style="overflow:auto; width:264px; height:358px">
                                                 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                     <ContentTemplate>
                                                         <asp:GridView ID="gvDetalleAlimento" runat="server" AutoGenerateColumns="False" 
                                                             BorderStyle="None" CellPadding="0" GridLines="Horizontal" 
                                                             onrowdeleting="gvDetaleAlimento_RowDeleting" Width="255px" CellSpacing="1">
                                                             <Columns>
                                                                 <asp:BoundField DataField="InsumoNombre" HeaderText="Insumo">
                                                                     <HeaderStyle Font-Bold="True" Font-Names="Arial" Font-Size="Small" 
                                                                         ForeColor="White" />
                                                                     <ItemStyle Font-Names="Arial" Font-Size="X-Small" ForeColor="White" />
                                                                 </asp:BoundField>
                                                                 <asp:BoundField DataField="cantidad" HeaderText="Cantidad">
                                                                     <HeaderStyle Font-Bold="True" Font-Names="Arial" Font-Size="Small" 
                                                                         ForeColor="White" />
                                                                     <ItemStyle Font-Names="Arial" Font-Size="X-Small" ForeColor="White" 
                                                                         HorizontalAlign="Right" />
                                                                 </asp:BoundField>
                                                                 <asp:BoundField DataField="unidadMedida" ShowHeader="False">
                                                                     <HeaderStyle Font-Bold="True" Font-Names="Arial" Font-Size="Small" 
                                                                         ForeColor="White" />
                                                                     <ItemStyle Font-Names="Arial" Font-Size="X-Small" ForeColor="White" 
                                                                         HorizontalAlign="Left" />
                                                                 </asp:BoundField>
                                                                 <asp:CommandField DeleteText="Quitar" ShowDeleteButton="True">
                                                                     <ItemStyle Font-Names="Arial" Font-Size="X-Small" ForeColor="White" />
                                                                 </asp:CommandField>
                                                             </Columns>
                                                             <HeaderStyle ForeColor="#0085C6" />
                                                         </asp:GridView>
                                                     </ContentTemplate>
                                                     <Triggers>
                                                         <asp:AsyncPostBackTrigger ControlID="btnAgregarInsumo" EventName="Click" />
                                                         <asp:AsyncPostBackTrigger ControlID="gvDetalleAlimento" 
                                                             EventName="RowDeleted" />
                                                         <asp:AsyncPostBackTrigger ControlID="gvDetalleAlimento" 
                                                             EventName="RowDeleting" />
                                                         <asp:AsyncPostBackTrigger ControlID="btnGuardar" EventName="Click" />
                                                     </Triggers>
                                                 </asp:UpdatePanel>
                                             </div>
                                         </td>
                                    </tr>
                                    <tr>
                                        <td class="style66">
                                        <asp:Label ID="Label6" runat="server" style="font-weight: 700; font-size: small;" 
                                    Text="Filtrar: "></asp:Label>   
                                  
                                  
                                    <input type="text" id="FilterTextBox" name="FilterTextBox" style="border: thick solid #00547D; color: #FFFFFF; font-family: tahoma; font-size: small; background-color: #0085C6; height: 20px;" />
            
                                        
                                        <div style="overflow:scroll; width:190px; height:154px" >
                                            <asp:GridView ID="gvInsumos" class="filtrar" runat="server" AutoGenerateColumns="False" 
                                                AllowSorting="True" style="text-align: left" 
                                                onselectedindexchanged="gvInsumos_SelectedIndexChanging" Width="190px">
                                                <Columns>
                                                    <asp:BoundField DataField="Nombre" HeaderText="Insumo" >
                                                        <ControlStyle Font-Names="Arial" Font-Size="X-Small" ForeColor="White" />
                                                        <HeaderStyle Font-Bold="True" Font-Names="Arial" ForeColor="White" />
                                                        <ItemStyle BorderStyle="None" Font-Names="Arial" Font-Size="X-Small" 
                                                            ForeColor="White" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="UnidadMedida" HeaderText="uMedida" Visible="False" />
                                                    <asp:BoundField DataField="Id" HeaderText="Id" Visible="False" />
                                                
                                                     <asp:CommandField ShowSelectButton="True" SelectText="Seleccionar" 
                                                        ShowCancelButton="False">
                                                       
                                                         <ControlStyle Width="60px" />
                                                       
                                                         <HeaderStyle Font-Names="Arial" Font-Size="X-Small" ForeColor="White" 
                                                             Width="60px" />
                                                         <ItemStyle Font-Names="Arial" Font-Size="X-Small" ForeColor="White" 
                                                             Width="60px" />
                                                       
                                                    </asp:CommandField>
                                                </Columns>
                                                
                                            </asp:GridView>
                                            </div>
                                            <asp:UpdatePanel ID="UpdatePanel5" runat="server">
                                                <ContentTemplate>
                                                    <asp:UpdatePanel ID="UpdatePanel9" runat="server">
                                                        <ContentTemplate>
                                                            <asp:Label ID="lblDebeSeleccionarInsumo" runat="server" 
                                                                style="color: #990000; font-size: x-small" 
                                                                Text="Por favor seleccione un insumo" Visible="False"></asp:Label>
                                                        </ContentTemplate>
                                                        <Triggers>
                                                            <asp:AsyncPostBackTrigger ControlID="btnAgregarInsumo" EventName="Click" />
                                                        </Triggers>
                                                    </asp:UpdatePanel>
                                                    <br />
                                                    <asp:Label ID="lblInsumo" runat="server" 
                                                        style="text-align: left; color: #FFFFFF"></asp:Label>
                                                    <br />
                                                    <br />
                                                    <asp:TextBox ID="txtCantidad" runat="server" BackColor="#0085C6" 
                                                        BorderStyle="None" BorderWidth="0px" Font-Italic="True" ForeColor="#CCCCCC" 
                                                        Height="20px" 
                                                        style="text-align: center" Width="60px"></asp:TextBox>
                                                    <cc1:FilteredTextBoxExtender ID="txtCantidad_FilteredTextBoxExtender" 
                                                        runat="server" Enabled="True" FilterType="Numbers" 
                                                        TargetControlID="txtCantidad" ValidChars="','">
                                                    </cc1:FilteredTextBoxExtender>
                                                    <cc1:TextBoxWatermarkExtender ID="txtCantidad_TextBoxWatermarkExtender" 
                                                        runat="server" TargetControlID="txtCantidad" WatermarkText="Cantidad">
                                                    </cc1:TextBoxWatermarkExtender>
                                                    &nbsp;
                                                    <asp:Label ID="lblUMedida" runat="server" 
                                                        style="color: #FFFFFF; font-weight: 700; font-size: small;" 
                                                        Text="Unidad de Medida"></asp:Label>
                                                    <asp:Label ID="lblCompletarCantidad" runat="server" 
                                                        style="color: #990000; font-size: x-small" Text="Completar" Visible="False"></asp:Label>
                                                    <br />
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="gvInsumos" 
                                                        EventName="SelectedIndexChanging" />
                                                    <asp:AsyncPostBackTrigger ControlID="btnAgregarInsumo" EventName="Click" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                            <br />
                                            &nbsp;<br />
                                            <br />
                                        </td>
                                        <td class="style67">
                                            <span>
                                            <asp:Button ID="btnAgregarInsumo" runat="server" BackColor="#0085C6" BorderStyle="None" 
                                                Font-Bold="True" Font-Italic="False" ForeColor="#CCCCCC" Height="20px" 
                                                style="margin-top: 0px" Text="&gt;&gt;" ToolTip="Agregar un nuevo Insumo" 
                                                ValidationGroup="1" Width="20px" onclick="btnAgregarInsumo_Click"  />
                                            </span></td>
                                    </tr>
                                    <tr>
                                        <td class="style68">
                                            <asp:DropDownList ID="ddlGrupoAlimento" runat="server" 
                                                AppendDataBoundItems="True" AutoPostBack="false" BackColor="#0085C6" 
                                                CssClass="style10" Font-Bold="False" Font-Italic="True" ForeColor="#CCCCCC" 
                                                Height="22px" style="font-family: Tahoma" ToolTip="Seleccione una opción" 
                                                Width="135px">
                                                <asp:ListItem>Grupo de Alimento</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td class="style65">
                                            <asp:UpdatePanel ID="UpdatePanel6" runat="server">
                                                <ContentTemplate>
                                                    <asp:Label ID="lblCheckGrupo" runat="server" style="color: #990000" Text="*" 
                                                        Visible="False"></asp:Label>
                                                </ContentTemplate>
                                                <Triggers>
                                                    <asp:AsyncPostBackTrigger ControlID="btnGuardar" EventName="Click" />
                                                </Triggers>
                                            </asp:UpdatePanel>
                                        </td>
                                        <td class="style63">
                                            &nbsp;</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td class="style62" bgcolor="#00334C" style="border-top-color: #000000; border-top-width: medium; border-top-style: solid;">
                                <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                                    <ContentTemplate>
                                        <asp:Label ID="lblMensaje" runat="server" ForeColor="Maroon" 
                                            style="color: #FF3300"></asp:Label>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="btnGuardar" />
                                    </Triggers>
                                </asp:UpdatePanel>
                            </td>
                            <td bgcolor="#00334C" style="text-align: right; border-top-color: #000000; border-top-width: medium; border-top-style: solid;">
                               <span>
                                <asp:Button ID="btnGuardar" runat="server" BackColor="#0085C6" 
                                    BorderStyle="None" Font-Bold="True" Font-Italic="False" ForeColor="#CCCCCC" 
                                    Height="23px" style="margin-top: 0px" Text="Guardar" 
                                    ValidationGroup="1" Width="60px" 
                                    onclick="btnGuardar_Click" />
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
                               
                               </td>
                        </tr>
                    </table>
                
                
                </asp:Panel>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        </table>





</asp:Content>



<%--<table style="width: 98%; margin-left: 5px; margin-right:10px; margin-bottom:5px; margin-top:5px;" 
                                    bgcolor="#00547D" cellpadding="-1" cellspacing="4">
                                    <tr>
                                        <td class="style63">
                                            <asp:TextBox ID="txtFecha" runat="server" BackColor="#0085C6" 
                                                BorderStyle="None" BorderWidth="0px" Font-Italic="True" ForeColor="#CCCCCC" 
                                                Height="20px" Width="200px"></asp:TextBox>
                                            <cc1:CalendarExtender ID="txtFecha_CalendarExtender" runat="server" 
                                                Enabled="True" TargetControlID="txtFecha">
                                            </cc1:CalendarExtender>
                                            <cc1:TextBoxWatermarkExtender ID="txtFecha_TextBoxWatermarkExtender" 
                                                runat="server" TargetControlID="txtFecha" WatermarkText="Fecha Estimada">
                                            </cc1:TextBoxWatermarkExtender>
                                        </td>
                                      
                                      
                                      
                                        <td class="style64" rowspan="10">
                                            <img alt="" src="Imagenes/linea%20vertical.png" 
                                                style="width: 1px; height: 90%" /></td>
                                        <td rowspan="10" valign="top">
                                            
                                            
                                            
                                            </td>
                                    </tr>
                                    <tr>
                                        <td class="style63">
                                            <asp:TextBox ID="tbxComentario" runat="server" BackColor="#0085C6" 
                                                BorderStyle="None" BorderWidth="0px" Font-Size="Small" ForeColor="#CCCCCC" 
                                                Height="70px" style="font-family: Tahoma" TextMode="MultiLine" Width="200px"></asp:TextBox>
                                            <cc1:TextBoxWatermarkExtender ID="tbxComentario_TextBoxWatermarkExtender" 
                                                runat="server" TargetControlID="tbxComentario" WatermarkText="Comentario">
                                            </cc1:TextBoxWatermarkExtender>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style63">
                                            <asp:TextBox ID="txtCantInvitados" runat="server" BackColor="#0085C6" 
                                                BorderStyle="None" BorderWidth="0px" Font-Italic="True" ForeColor="#CCCCCC" 
                                                Height="20px" Width="200px"></asp:TextBox>
                                            <cc1:FilteredTextBoxExtender ID="txtCantInvitados_FilteredTextBoxExtender" 
                                                runat="server" Enabled="True" FilterType="Numbers" 
                                                TargetControlID="txtCantInvitados">
                                            </cc1:FilteredTextBoxExtender>
                                            <cc1:TextBoxWatermarkExtender ID="txtCantInvitados_TextBoxWatermarkExtender" 
                                                runat="server" TargetControlID="txtCantInvitados" 
                                                WatermarkText="Cantidad de Invitados">
                                            </cc1:TextBoxWatermarkExtender>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style63">
                                            <asp:DropDownList ID="ddlSalon" runat="server" AppendDataBoundItems="True" 
                                                AutoPostBack="True" BackColor="#0085C6" CssClass="style10" 
                                                onselectedindexchanged="ddlSalon_SelectedIndexChanged" 
                                                style="font-family: Tahoma; height: 26px; font-style: italic;" Width="200px">
                                                <asp:ListItem Value="Salon">Salón</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style63">
                                            &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td class="style63">
                                             &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td class="style63">
                                            &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td class="style63">
                                             &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td class="style63">
                                            &nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td class="style63">
                                            
                                             &nbsp;</td>
                                    </tr>
                                </table>--%>